package ooday02;
/** 重写的演示 */
public class OverrideDemo {
    public static void main(String[] args) {
        //重写方法被调用时，看对象的类型执行方法
        Student zs = new Student("张三",25,"廊坊","jsd2307","001");
        zs.sayHi(); //调用Student重写之后的
        Teacher ls = new Teacher("李四",35,"佳木斯",6000.0);
        ls.sayHi(); //调用Teacher重写之后的
        Doctor ww = new Doctor("王五",45,"山东","主任医师");
        ww.sayHi(); //调用Person中的
    }
}














